<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use DB;

class Checkaccord extends Model
{
    //
    protected $table = 'checkaccord';
    public $timestamps = false;

    public function getAccordByCheckAgainId($checkAgainId)
    {
        $checkaccords = DB::select("
            select accord.entryId,accord.title,accord.content from checkaccord accord
            left join comcheckagaindetail ckdetail on accord.entryId = ckdetail.entryId where ckdetail.checkId = $checkAgainId
            ");
        return $checkaccords;
    }

    public function getAccordByCheckId($checkId)
    {
        $checkaccords = DB::select("
            select accord.entryId,accord.title,accord.content from checkaccord accord
            left join comcheckdetail ckdetail on accord.entryId = ckdetail.entryId where ckdetail.checkId = $checkId
            ");
        return $checkaccords;
    }
}
